#include "StdAfx.h"
#include "TLine.h"
#include "topengl.h"

void TLine::DrawMySelf(TOpenGL *pGL) const
{
	pGL->GlVertexPt(m_ptStart);
	pGL->GlVertexPt(m_ptEnd);
}

TExtent TLine::GetExtent() const
{
	return TExtent(
		AcGePoint3d(	max(m_ptStart.x, m_ptEnd.x), 
				max(m_ptStart.y, m_ptEnd.y), 
				max(m_ptStart.z, m_ptEnd.z)
				), 
		AcGePoint3d( min(m_ptStart.x, m_ptEnd.x), 
				min(m_ptStart.y, m_ptEnd.y), 
				min(m_ptStart.z, m_ptEnd.z)
				)
		);
}

TLine& TLine::operator=( const TLine &line )
{
	if (&line == this)
		return *this;
	m_ptStart = line.m_ptStart;
	m_ptEnd = line.m_ptEnd;
	return *this;
}

void TLine::TransformBy( const AcGeMatrix3d &mat )
{
	m_ptEnd.transformBy(mat);
	m_ptStart.transformBy(mat);
}